﻿$_Date = Get-Date -format yyyyMMdd-HHmm

$csv_file = Import-Csv test.txt

foreach($line in $csv_file)
{
    if ( (test-path $($line.filestocopy)) -and ($($line.filestocopy) -ne "*.*") ) {$FilesToCopy = Get-Content $($line.filestocopy)} else {$FilesToCopy = $($line.filestocopy)}
    if ($($line.filestoexclude)) {$FilesToExclude = Get-Content $($line.filestoexclude); $FilesToExclude = "/XF "+$FilesToExclude} else {$FilesToExclude = ""}
    if ($($line.directorytoexclude)) {$DirectorysToExclude = Get-Content $($line.directorytoexclude); $DirectorysToExclude = "/XD "+$DirectorysToExclude} else {$DirectorysToExclude = ""}
    write-host robocopy $($line.source) $($line.destination) $FilesToCopy $FilesToExclude $DirectorysToExclude $($line.options)
 }
# SIG # Begin signature block
# MIID6AYJKoZIhvcNAQcCoIID2TCCA9UCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUNnH7vVDtCGmrNA3P5qnDpvgP
# F8OgggINMIICCTCCAXagAwIBAgIQZ+hQJZqbS7VOF+Cj8pvhJzAJBgUrDgMCHQUA
# MBExDzANBgNVBAMTBk9TQU1FUzAeFw0xMjAyMTYxMzExNDlaFw0zOTEyMzEyMzU5
# NTlaMCAxHjAcBgNVBAMTFU9TQU1FUyBmb3IgcG93ZXJzaGVsbDCBnzANBgkqhkiG
# 9w0BAQEFAAOBjQAwgYkCgYEAiFQX6HAC+1mK8Ib0iqyH92/HGiRXIVWvNj+/wDgF
# h86ObW4IGuqZAceQcE4AbUHC35cXGRyZbN9cm6FE/hSGwE8M4cvK4JjWWHhkD81V
# oPT2zIlx2C/Ge++3iA4ZpBRP+oNHtcENCIJtxNIwAGjSivtg6HJzkLySeWJmgE2A
# tasCAwEAAaNbMFkwEwYDVR0lBAwwCgYIKwYBBQUHAwMwQgYDVR0BBDswOYA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